<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script type="text/javascript" src="jquery.zclip.js"></script>
</head>
<body>

<script>
function copyTable(buttonId,tableId){
	$("#"+buttonId).zclip({
		path : "ZeroClipboard.swf",
		copy : function() {
			var tableContent = "";
			$("#"+tableId).find("tr").each(function(){
				$(this).find("td").each(function(i, n){
					if(i==0){
						tableContent = tableContent + $(this).text();
					}else{
						tableContent = tableContent + "\t" + $(this).text();
					}
				});
				tableContent = tableContent + "\r\n";
			});
			return tableContent;
		},
        afterCopy:function(){
            alert("表格复制成功！");
        }

	});
}

$(document).ready(function(){
	copyTable('button','table');
});

</script> 

<input type="button" id="button" value="复制" >

<table id="table">
<tr><td>1</td><td>aaaaa</td><td>张三</td></tr>
<tr><td>2</td><td>bbbbb</td><td>李四</td></tr>
<tr><td>3</td><td>ccccc</td><td>王五</td></tr>
</table>

</body>
</html>